package com.ycz.master.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycz.master.mapper.UserAndDataFilingMapper;
import com.ycz.master.pojo.User;
import com.ycz.master.pojo.UserAndDatafiling;
import com.ycz.master.service.UserAndDataFilingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * author zyc
 * Created on 2021/9/29 18:34
 */
@Service
public class UserAndDataFilingServiceImpl extends ServiceImpl<UserAndDataFilingMapper, UserAndDatafiling> implements UserAndDataFilingService {

    @Autowired
    UserAndDataFilingMapper mapper;
    @Autowired
    RedisTemplate<Object,Object> redisTemplate;

    public List<UserAndDatafiling> findall(){
       return mapper.findall();
    }


    //查询所有用户
    @Override
    public List<UserAndDatafiling> bankfindall() {
//        List<UserAndDatafiling> bankalluser=new ArrayList<>();
//        bankalluser = (List<UserAndDatafiling>) redisTemplate.opsForValue().get("bankallusers");
//        if(bankalluser==null) {
//            bankalluser=  mapper.bankfindall();
//            redisTemplate.opsForValue().set("bankallusers",bankalluser,20, TimeUnit.SECONDS);
//        }
//        return bankalluser;
       return mapper.bankfindall();


    }
}
